home *** CD-ROM | disk | FTP | other *** search
/ Amiga Plus 2002 #3 / Amiga Plus CD - 2002 - No. 03.iso / AmigaPlus / AmigaOS / Aplus_Dev / AP-Website / links / admin / add_site.php next >
Encoding:
PHP Script  |  2002-10-28  |  3.6 KB  |  148 lines

  1. <?
  2. // *******************************************************************
  3. //  admin/add_site.php
  4. // *******************************************************************
  5.  
  6. include("../include/config.php");
  7. include("../include/functions.php");
  8.  
  9. include("../include/common.php");
  10. $language = $gl["Language"];
  11.  
  12. include("../include/lang/$language.php");
  13.  
  14. include("../include/session.php");
  15. session_start();
  16. ?>
  17. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  18. "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 
  19. <html>
  20. <head>
  21. <title></title>
  22. <link rel = "stylesheet" type = "text/css" href = "style.css" />
  23. <?
  24. if(isset($add)){
  25.     ?><META
  26.         HTTP-EQUIV="Refresh"
  27.         CONTENT="1; URL=add_site.php?<?=session_name()?>=<?=session_id()?>"><?
  28. }
  29. ?>
  30. </head>
  31. <?=$adm_body?>
  32. <?
  33.  
  34. if(isset($add))
  35. {
  36.     $result = sql_query("
  37.         insert into
  38.             $tb_links (
  39.                 ID, 
  40.                 SiteName,
  41.                 SiteURL,
  42.                 Description,
  43.                 Category,
  44.                 Country,
  45.                 Email,
  46.                 UserName,
  47.                 Password,
  48.                 Hint,
  49.                 Added,
  50.                 LastUpdate
  51.             )
  52.             values (
  53.                 '',
  54.                 '$SiteName',
  55.                 '$SiteURL',
  56.                 '$Description',
  57.                 '$Category',
  58.                 '$Country',
  59.                 '$Email',
  60.                 '$UserName',
  61.                 password('$Password'),
  62.                 '$Hint',
  63.                 now()+0,
  64.                 now()+0
  65.             )
  66.         ");
  67.  
  68.     ?>
  69.     <table cellspacing="0" cellpadding="5" border="1" align="center" width="100%">
  70.     <tr>
  71.         <td class="theader" align="center">Site Has been added.<br /><br /><a href="add_site.php?<?=session_name()?>=<?=session_id()?>">Click Here to Continue</a></td>
  72.     </tr>
  73.     </table>
  74.     <br>
  75. <?
  76. } else {
  77.     ?>
  78.     <table cellspacing="0" cellpadding="5" border="1" align="center" width="100%">
  79.     <tr><form method="post" action="add_site.php?<?=session_name()?>=<?=session_id()?>">
  80.         <td colspan="2" class="theader">Add Site Manually<br />
  81.         <span class="transtext">No validation is performed, but duplicate URLs will not 
  82.         be added<br>due to unique key associated with SiteURL field 
  83.         in <?=$tb_links?> table.</span></td>
  84.     </tr>
  85.     <tr>
  86.         <td class="text">Site Name: </td>
  87.         <td><input class="small" type="text" name="SiteName" size="35"></td>
  88.     </tr>
  89.     <tr>
  90.         <td class="text">Site URL: </td>
  91.         <td><input class="small" type="text" name="SiteURL" size="35"></td>
  92.     </tr>
  93.     <tr>
  94.         <td class="text">Description: </td>
  95.         <td><textarea class="small" name="Description" rows="7" cols="40" wrap="virtual"></textarea></td>
  96.     </tr>
  97.     <tr>
  98.         <td class="text">Category: </td>
  99.         <td><select class="small" name="Category"><?
  100.         
  101.         drop_cats($rows[Category], 0, "", $cats);
  102.         echo $cats;
  103.         
  104.         ?></select></td>
  105.     </tr>
  106.     <tr>
  107.         <td class="text"><?=$add_46?></td>
  108.         <td><select class="small" name="Country">
  109.         <option value="">Please Select</option><?
  110.         if(!isset($Country)){
  111.             $Country = $default_country;
  112.         }
  113.         if($d = dir("../images/flags")){
  114.             echo getFlagList("../images/flags", $Country);
  115.         }
  116.         ?></select></td>
  117.     </tr>
  118.     <tr>
  119.         <td class="text">Email</td>
  120.         <td><input class="small" type="text" name="Email" size="35" 
  121.         value="<?=$prefill_email?>"></td>
  122.     </tr>
  123.     <tr>
  124.         <td class="text">UserName: </td>
  125.         <td><input class="small" type="text" name="UserName" size="16" 
  126.         value="<?=$prefill_username?>"></td>
  127.     </tr>
  128.     <tr>
  129.         <td class="text">Password: </td>
  130.         <td><input class="small" type="text" name="Password" size="16" 
  131.         value="<?=$prefill_password?>"></td>
  132.     </tr>
  133.     <tr>
  134.         <td class="text">Password Hint: </td>
  135.         <td><input class="small" type="text" name="Hint" size="16" 
  136.         value="<?=$prefill_hint?>"></td>
  137.     </tr>
  138.     <tr>
  139.         <td colspan="2" align="center"><input class="button" type="submit" name="add" 
  140.         value=" Add Site "></td>
  141.     </form></tr>
  142.     </table>
  143.     <?
  144. }
  145. ?>
  146. </body>
  147. </html>
  148.